/* 全局样式 */
:root {
    --primary-color: #4e73df;
    --primary-hover: #2e59d9;
    --success-color: #1cc88a;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
    --border-color: #e3e6f0;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    --shadow-lg: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.2);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

body {
    padding-top: 70px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #F0F0F0;
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}

.row {
    margin-bottom: 20px;
}

.row-flex {
    display: flex;
    flex-wrap: wrap;
    margin-top: calc(-1* var(--bs-gutter-y));
    margin-right: calc(-.5* var(--bs-gutter-x));
    margin-left: calc(-.5* var(--bs-gutter-x));
}

/* 导航栏样式 */
.navbar {
    box-shadow: var(--shadow-sm);
}

.navbar-brand i {
    margin-right: 5px;
    color: var(--primary-color);
}

.nav-link i {
    margin-right: 5px;
}

/* 头像样式 */
.avatar-sm {
    width: 30px;
    height: 30px;
    object-fit: cover;
    margin-right: 5px;
    border-radius: 50%;
}

.avatar-md {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-lg {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
}

/* 卡片样式 */
.card {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: none;
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
}

/* 表单样式 */
.form-control {
    border-radius: 0.35rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.btn {
    border-radius: 0.35rem;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* 好友列表样式 */
.friend-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.08);
    height: 100%;
    display: flex;
    align-items: center;
}

.friend-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    background-color: var(--light-color);
}

.friend-list {
    width: 100%;
}

.d-flex {
    align-items: center;
}

.friend-info {
    margin-left: 15px;
}

.friend-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.friend-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.intimacy-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.friend-card .progress {
    height: 5px;
    border-radius: 3px;
    background-color: rgba(0, 0, 0, 0.05);
}

/* 事务列表样式 */
.task-card {
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.task-card:hover {
    background-color: var(--light-color);
}

.task-pending {
    border-left-color: var(--warning-color);
}

.task-completed {
    border-left-color: var(--success-color);
}

.task-expired {
    border-left-color: var(--danger-color);
}

.deadline {
    font-size: 0.85rem;
    color: var(--dark-color);
}

.deadline-soon {
    color: var(--danger-color);
    font-weight: bold;
}

/* 统计卡片样式 */
.stat-card {
    text-align: center;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-card .label {
    font-size: 1rem;
    color: var(--dark-color);
}

/* 特性图标样式 */
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 页脚样式 */
.footer {
    margin-top: auto;
    background-color: var(--light-color) !important;
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
}

/* 个人资料页面样式 */
.profile-container {
    display: flex;
    justify-content: center;
}

.profile-container .col-md-5 {
    width: 100%;
    max-width: 500px;
}

/* 响应式调整 */
@media (max-width: 576px) {
    body {
        padding-top: 60px;
    }
    
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    h5 {
        font-size: 1.1rem;
    }
    
    .avatar-md {
        width: 45px;
        height: 45px;
    }
    
    .avatar-lg {
        width: 90px;
        height: 90px;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .friend-card {
        padding: 0.75rem;
    }
    
    .friend-card h5 {
        font-size: 1rem;
    }
    
    .friend-actions .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col-md-4 {
        margin-bottom: 10px;
    }
    
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, 
    .col-sm, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, 
    .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, 
    .col-sm-10, .col-sm-11, .col-sm-12, .col-md, .col-md-1, 
    .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, 
    .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, 
    .col-md-12 {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* 触摸设备优化 */
@media (hover: none) {
    .card:hover {
        transform: none;
    }
    
    .friend-card:hover {
        transform: none;
    }
    
    a:hover, button:hover {
        transition: none;
    }
    
    input, select, textarea {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body.dark-mode {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    body.dark-mode .card {
        background-color: #1e1e1e;
        border-color: #333;
    }
    
    body.dark-mode .card-header {
        background-color: #252525;
        border-color: #333;
    }
    
    body.dark-mode .navbar {
        background-color: #1e1e1e !important;
    }
    
    body.dark-mode .text-muted {
        color: #aaa !important;
    }
}
